package service;

import entity.Student;
import dao.StudentDao;

import java.util.*;

public class StudentService {
    private final StudentDao studentDao = new StudentDao();

    //查询全部
    public List<Student> queryStudent() {
        return studentDao.queryStudent();
    }

    //单个查询
    public Student queryStudentById(Integer id) {
        return studentDao.queryStudentById(id);
    }

    //添加
    public int saveStudent(Student obj) {
        return studentDao.saveStudent(obj);
    }

    //删除
    public int deleteStudentById(Integer id) {
        return studentDao.deleteStudentById(id);
    }

    //修改
    public int updateStudentById(Student obj) {
        return studentDao.updateStudentById(obj);
    }
}
